<?php
/*
 * @Author: lokei
 * @Date: 2022-10-12 16:53:03
 * @LastEditors: lokei
 * @LastEditTime: 2022-11-18 15:19:57
 * @Description: 
 */
namespace App\Http\Controllers\Store\Bank;

use App\Common\Tools\ResultTool;
use App\Http\Controllers\Controller;
use App\Models\Store\StoreModel;
use Illuminate\Http\Request;

class BankController extends Controller {
    public function get(Request $request) {
        $store = StoreModel::where('id', '=', $request->input('id'))->first();
        $res = ResultTool::success();
        $res['data']['bank_id'] = $store->bank_id;
        $res['data']['bank_name'] = $store->bank_name;
        $res['data']['bank_username'] = $store->bank_username;
        return $res;
    }

    public function update(Request $request) {
        $store = StoreModel::where('id', '=', $request->input('id'))->first();
        $store->bank_id = $request->input('bank_id');
        $store->bank_name = $request->input('bank_name');
        $store->bank_username = $request->input('bank_username');
        $store->save();
        return ResultTool::success();
    }
}